home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / u_man / cat3 / Tk / listbox.z / listbox
Encoding:
Text File  |  1998-10-30  |  32.2 KB  |  595 lines

  1.  
  2.  
  3.  
  4. lllliiiissssttttbbbbooooxxxx((((3333TTTTkkkk))))                                                      lllliiiissssttttbbbbooooxxxx((((3333TTTTkkkk))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      listbox - Create and manipulate listbox widgets
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      lllliiiissssttttbbbbooooxxxx _p_a_t_h_N_a_m_e ?_o_p_t_i_o_n_s?
  13.  
  14. SSSSTTTTAAAANNNNDDDDAAAARRRRDDDD OOOOPPPPTTTTIIIIOOOONNNNSSSS
  15.      bbbbaaaacccckkkkggggrrrroooouuuunnnndddd       ffffoooonnnntttt                 rrrreeeelllliiiieeeeffff             ttttaaaakkkkeeeeFFFFooooccccuuuussss       |
  16.      bbbboooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh      hhhheeeeiiiigggghhhhtttt               sssseeeelllleeeeccccttttBBBBaaaacccckkkkggggrrrroooouuuunnnndddd   wwwwiiiiddddtttthhhh           |
  17.      ccccuuuurrrrssssoooorrrr           hhhhiiiigggghhhhlllliiiigggghhhhttttBBBBaaaacccckkkkggggrrrroooouuuunnnndddd  sssseeeelllleeeeccccttttBBBBoooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh  xxxxSSSSccccrrrroooollllllllCCCCoooommmmmmmmaaaannnndddd  |
  18.      eeeexxxxppppoooorrrrttttSSSSeeeelllleeeeccccttttiiiioooonnnn  hhhhiiiigggghhhhlllliiiigggghhhhttttCCCCoooolllloooorrrr       sssseeeelllleeeeccccttttFFFFoooorrrreeeeggggrrrroooouuuunnnndddd   yyyySSSSccccrrrroooollllllllCCCCoooommmmmmmmaaaannnndddd  |
  19.      ffffoooorrrreeeeggggrrrroooouuuunnnndddd       hhhhiiiigggghhhhlllliiiigggghhhhttttTTTThhhhiiiicccckkkknnnneeeessssssss   sssseeeettttGGGGrrrriiiidddd
  20.  
  21.      See the ``options'' manual entry for details on the standard options.
  22.  
  23. WWWWIIIIDDDDGGGGEEEETTTT----SSSSPPPPEEEECCCCIIIIFFFFIIIICCCC OOOOPPPPTTTTIIIIOOOONNNNSSSS
  24.      Name:           hhhheeeeiiiigggghhhhtttt
  25.      Class:          HHHHeeeeiiiigggghhhhtttt
  26.      Command-Line Switch:----hhhheeeeiiiigggghhhhtttt
  27.  
  28.           Specifies the desired height for the window, in lines.  If zero or  |
  29.           less, then the desired height for the window is made just large     |
  30.           enough to hold all the elements in the listbox.
  31.  
  32.      Name:           sssseeeelllleeeeccccttttMMMMooooddddeeee                                               |
  33.      Class:          SSSSeeeelllleeeeccccttttMMMMooooddddeeee                                               |
  34.      Command-Line Switch:----sssseeeelllleeeeccccttttmmmmooooddddeeee                                          |
  35.  
  36.           Specifies one of several styles for manipulating the selection.  The|
  37.           value of the option may be arbitrary, but the default bindings      |
  38.           expect it to be either ssssiiiinnnngggglllleeee, bbbbrrrroooowwwwsssseeee, mmmmuuuullllttttiiiipppplllleeee, or eeeexxxxtttteeeennnnddddeeeedddd;  the  |
  39.           default value is bbbbrrrroooowwwwsssseeee.
  40.  
  41.      Name:           wwwwiiiiddddtttthhhh
  42.      Class:          WWWWiiiiddddtttthhhh
  43.      Command-Line Switch:----wwwwiiiiddddtttthhhh
  44.  
  45.           Specifies the desired width for the window in characters.  If the
  46.           font doesn't have a uniform width then the width of the character
  47.           ``0'' is used in translating from character units to screen units.  |
  48.           If zero or less, then the desired width for the window is made just |
  49.           large enough to hold all the elements in the listbox.
  50.  
  51.  
  52. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  53.      The lllliiiissssttttbbbbooooxxxx command creates a new window (given by the _p_a_t_h_N_a_m_e argument)
  54.      and makes it into a listbox widget.  Additional options, described above,
  55.      may be specified on the command line or in the option database to
  56.      configure aspects of the listbox such as its colors, font, text, and
  57.      relief.  The lllliiiissssttttbbbbooooxxxx command returns its _p_a_t_h_N_a_m_e argument.  At the time
  58.      this command is invoked, there must not exist a window named _p_a_t_h_N_a_m_e,
  59.      but _p_a_t_h_N_a_m_e's parent must exist.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. lllliiiissssttttbbbbooooxxxx((((3333TTTTkkkk))))                                                      lllliiiissssttttbbbbooooxxxx((((3333TTTTkkkk))))
  71.  
  72.  
  73.  
  74.      A listbox is a widget that displays a list of strings, one per line.
  75.      When first created, a new listbox has no elements.  Elements may be added
  76.      or deleted using widget commands described below.  In addition, one or
  77.      more elements may be selected as described below.  If a listbox is
  78.      exporting its selection (see eeeexxxxppppoooorrrrttttSSSSeeeelllleeeeccccttttiiiioooonnnn option), then it will
  79.      observe the standard X11 protocols for handling the selection.  Listbox
  80.      selections are available as type SSSSTTTTRRRRIIIINNNNGGGG; the value of the selection will |
  81.      be the text of the selected elements, with newlines separating the       |
  82.      elements.                                                                |
  83.  
  84.      It is not necessary for all the elements to be displayed in the listbox  |
  85.      window at once;  commands described below may be used to change the view |
  86.      in the window.  Listboxes allow scrolling in both directions using the   |
  87.      standard xxxxSSSSccccrrrroooollllllllCCCCoooommmmmmmmaaaannnndddd and yyyySSSSccccrrrroooollllllllCCCCoooommmmmmmmaaaannnndddd options.  They also support   |
  88.      scanning, as described below.                                            |
  89.  
  90.  
  91. IIIINNNNDDDDIIIICCCCEEEESSSS                                                                       ||||
  92.      Many of the widget commands for listboxes take one or more indices as    |
  93.      arguments.  An index specifies a particular element of the listbox, in   |
  94.      any of the following ways:
  95.  
  96.      _n_u_m_b_e_r      Specifies the element as a numerical index, where 0
  97.                  corresponds to the first element in the listbox.
  98.  
  99.      aaaaccccttttiiiivvvveeee      Indicates the element that has the location cursor.  This    |
  100.                  element will be displayed with an underline when the listbox |
  101.                  has the keyboard focus, and it is specified with the aaaaccccttttiiiivvvvaaaatttteeee|
  102.                  widget command.
  103.  
  104.      aaaannnncccchhhhoooorrrr      Indicates the anchor point for the selection, which is set   |
  105.                  with the sssseeeelllleeeeccccttttiiiioooonnnn aaaannnncccchhhhoooorrrr widget command.
  106.  
  107.      eeeennnndddd         Indicates the end of the listbox.  For some commands this
  108.                  means just after the last element; for other commands it
  109.                  means the last element.
  110.  
  111.      @@@@_x,,,,_y        Indicates the element that covers the point in the listbox   |
  112.                  window specified by _x and _y (in pixel coordinates).  If no   |
  113.                  element covers that point, then the closest element to that  |
  114.                  point is used.                                               |
  115.  
  116.      In the widget command descriptions below, arguments named _i_n_d_e_x, _f_i_r_s_t,  |
  117.      and _l_a_s_t always contain text indices in one of the above forms.
  118.  
  119.  
  120. WWWWIIIIDDDDGGGGEEEETTTT CCCCOOOOMMMMMMMMAAAANNNNDDDD
  121.      The lllliiiissssttttbbbbooooxxxx command creates a new Tcl command whose name is _p_a_t_h_N_a_m_e.
  122.      This command may be used to invoke various operations on the widget.  It
  123.      has the following general form:
  124.  
  125.           _p_a_t_h_N_a_m_e _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. lllliiiissssttttbbbbooooxxxx((((3333TTTTkkkk))))                                                      lllliiiissssttttbbbbooooxxxx((((3333TTTTkkkk))))
  137.  
  138.  
  139.  
  140.      _O_p_t_i_o_n and the _a_r_gs determine the exact behavior of the command.  The
  141.      following commands are possible for listbox widgets:
  142.  
  143.      _p_a_t_h_N_a_m_e aaaaccccttttiiiivvvvaaaatttteeee _i_n_d_e_x
  144.           Sets the active element to the one indicated by _i_n_d_e_x.  The active  |
  145.           element is drawn with an underline when the widget has the input    |
  146.           focus, and its index may be retrieved with the index aaaaccccttttiiiivvvveeee.
  147.  
  148.      _p_a_t_h_N_a_m_e bbbbbbbbooooxxxx _i_n_d_e_x
  149.           Returns a list of four numbers describing the bounding box of the   |
  150.           text in the element given by _i_n_d_e_x.  The first two elements of the  |
  151.           list give the x and y coordinates of the upper-left corner of the   |
  152.           screen area covered by the text (specified in pixels relative to the|
  153.           widget) and the last two elements give the width and height of the  |
  154.           area, in pixels.  If no part of the element given by _i_n_d_e_x is       |
  155.           visible on the screen then the result is an empty string;  if the   |
  156.           element is partially visible, the result gives the full area of the |
  157.           element, including any parts that are not visible.
  158.  
  159.      _p_a_t_h_N_a_m_e ccccggggeeeetttt _o_p_t_i_o_n
  160.           Returns the current value of the configuration option given by      |
  161.           _o_p_t_i_o_n.  _O_p_t_i_o_n may have any of the values accepted by the lllliiiissssttttbbbbooooxxxx  |
  162.           command.
  163.  
  164.      _p_a_t_h_N_a_m_e ccccoooonnnnffffiiiigggguuuurrrreeee ?_o_p_t_i_o_n? ?_v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?
  165.           Query or modify the configuration options of the widget.  If no
  166.           _o_p_t_i_o_n is specified, returns a list describing all of the available
  167.           options for _p_a_t_h_N_a_m_e (see TTTTkkkk____CCCCoooonnnnffffiiiigggguuuurrrreeeeIIIInnnnffffoooo for information on the
  168.           format of this list).  If _o_p_t_i_o_n is specified with no _v_a_l_u_e, then
  169.           the command returns a list describing the one named option (this
  170.           list will be identical to the corresponding sublist of the value
  171.           returned if no _o_p_t_i_o_n is specified).  If one or more _o_p_t_i_o_n-_v_a_l_u_e
  172.           pairs are specified, then the command modifies the given widget
  173.           option(s) to have the given value(s);  in this case the command
  174.           returns an empty string.  _O_p_t_i_o_n may have any of the values accepted
  175.           by the lllliiiissssttttbbbbooooxxxx command.
  176.  
  177.      _p_a_t_h_N_a_m_e ccccuuuurrrrsssseeeelllleeeeccccttttiiiioooonnnn
  178.           Returns a list containing the numerical indices of all of the
  179.           elements in the listbox that are currently selected.  If there are
  180.           no elements selected in the listbox then an empty string is
  181.           returned.
  182.  
  183.      _p_a_t_h_N_a_m_e ddddeeeelllleeeetttteeee _f_i_r_s_t ?_l_a_s_t?
  184.           Deletes one or more elements of the listbox.  _F_i_r_s_t and _l_a_s_t are
  185.           indices specifying the first and last elements in the range to
  186.           delete.  If _l_a_s_t isn't specified it defaults to _f_i_r_s_t, i.e. a single
  187.           element is deleted.
  188.  
  189.      _p_a_t_h_N_a_m_e ggggeeeetttt _f_i_r_s_t ?_l_a_s_t?
  190.           If _l_a_s_t is omitted, returns the contents of the listbox element
  191.           indicated by _f_i_r_s_t.  If _l_a_s_t is specified, the command returns a    |
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. lllliiiissssttttbbbbooooxxxx((((3333TTTTkkkk))))                                                      lllliiiissssttttbbbbooooxxxx((((3333TTTTkkkk))))
  203.  
  204.  
  205.  
  206.           list whose elements are all of the listbox elements between _f_i_r_s_t   |
  207.           and _l_a_s_t, inclusive.  Both _f_i_r_s_t and _l_a_s_t may have any of the       |
  208.           standard forms for indices.
  209.  
  210.      _p_a_t_h_N_a_m_e iiiinnnnddddeeeexxxx _i_n_d_e_x
  211.           Returns a decimal string giving the integer index value that
  212.           corresponds to _i_n_d_e_x.
  213.  
  214.      _p_a_t_h_N_a_m_e iiiinnnnsssseeeerrrrtttt _i_n_d_e_x ?_e_l_e_m_e_n_t _e_l_e_m_e_n_t ...?
  215.           Inserts zero or more new elements in the list just before the       |
  216.           element given by _i_n_d_e_x.  If _i_n_d_e_x is specified as eeeennnndddd then the new  |
  217.           elements are added to the end of the list.  Returns an empty string.
  218.  
  219.      _p_a_t_h_N_a_m_e nnnneeeeaaaarrrreeeesssstttt _y
  220.           Given a y-coordinate within the listbox window, this command returns
  221.           the index of the (visible) listbox element nearest to that y-
  222.           coordinate.
  223.  
  224.      _p_a_t_h_N_a_m_e ssssccccaaaannnn _o_p_t_i_o_n _a_r_g_s
  225.           This command is used to implement scanning on listboxes.  It has two
  226.           forms, depending on _o_p_t_i_o_n:
  227.  
  228.           _p_a_t_h_N_a_m_e ssssccccaaaannnn mmmmaaaarrrrkkkk _x _y
  229.                Records _x and _y and the current view in the listbox window;
  230.                used in conjunction with later ssssccccaaaannnn ddddrrrraaaaggggttttoooo commands.  Typically
  231.                this command is associated with a mouse button press in the
  232.                widget.  It returns an empty string.
  233.  
  234.           _p_a_t_h_N_a_m_e ssssccccaaaannnn ddddrrrraaaaggggttttoooo _x _y.
  235.                This command computes the difference between its _x and _y
  236.                arguments and the _x and _y arguments to the last ssssccccaaaannnn mmmmaaaarrrrkkkk
  237.                command for the widget.  It then adjusts the view by 10 times
  238.                the difference in coordinates.  This command is typically
  239.                associated with mouse motion events in the widget, to produce
  240.                the effect of dragging the list at high speed through the
  241.                window.  The return value is an empty string.
  242.  
  243.      _p_a_t_h_N_a_m_e sssseeeeeeee _i_n_d_e_x
  244.           Adjust the view in the listbox so that the element given by _i_n_d_e_x is|
  245.           visible.  If the element is already visible then the command has no |
  246.           effect; if the element is near one edge of the window then the      |
  247.           listbox scrolls to bring the element into view at the edge;         |
  248.           otherwise the listbox scrolls to center the element.
  249.  
  250.      _p_a_t_h_N_a_m_e sssseeeelllleeeeccccttttiiiioooonnnn _o_p_t_i_o_n _a_r_g
  251.           This command is used to adjust the selection within a listbox.  It
  252.           has several forms, depending on _o_p_t_i_o_n:
  253.  
  254.           _p_a_t_h_N_a_m_e sssseeeelllleeeeccccttttiiiioooonnnn aaaannnncccchhhhoooorrrr _i_n_d_e_x
  255.                Sets the selection anchor to the element given by _i_n_d_e_x.  The
  256.                selection anchor is the end of the selection that is fixed
  257.                while dragging out a selection with the mouse.  The index
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. lllliiiissssttttbbbbooooxxxx((((3333TTTTkkkk))))                                                      lllliiiissssttttbbbbooooxxxx((((3333TTTTkkkk))))
  269.  
  270.  
  271.  
  272.                aaaannnncccchhhhoooorrrr may be used to refer to the anchor element.
  273.  
  274.           _p_a_t_h_N_a_m_e sssseeeelllleeeeccccttttiiiioooonnnn cccclllleeeeaaaarrrr _f_i_r_s_t ?_l_a_s_t?
  275.                If any of the elements between _f_i_r_s_t and _l_a_s_t (inclusive) are
  276.                selected, they are deselected.  The selection state is not
  277.                changed for elements outside this range.
  278.  
  279.           _p_a_t_h_N_a_m_e sssseeeelllleeeeccccttttiiiioooonnnn iiiinnnncccclllluuuuddddeeeessss _i_n_d_e_x
  280.                Returns 1 if the element indicated by _i_n_d_e_x is currently
  281.                selected, 0 if it isn't.
  282.  
  283.           _p_a_t_h_N_a_m_e sssseeeelllleeeeccccttttiiiioooonnnn sssseeeetttt _f_i_r_s_t ?_l_a_s_t?
  284.                Selects all of the elements in the range between _f_i_r_s_t and
  285.                _l_a_s_t, inclusive, without affecting the selection state of
  286.                elements outside that range.
  287.  
  288.      _p_a_t_h_N_a_m_e ssssiiiizzzzeeee
  289.           Returns a decimal string indicating the total number of elements in
  290.           the listbox.
  291.  
  292.      _p_a_t_h_N_a_m_e xxxxvvvviiiieeeewwww _a_r_g_s
  293.           This command is used to query and change the horizontal position of
  294.           the information in the widget's window.  It can take any of the
  295.           following forms:
  296.  
  297.           _p_a_t_h_N_a_m_e xxxxvvvviiiieeeewwww
  298.                Returns a list containing two elements.  Each element is a real
  299.                fraction between 0 and 1;  together they describe the
  300.                horizontal span that is visible in the window.  For example, if
  301.                the first element is .2 and the second element is .6, 20% of
  302.                the listbox's text is off-screen to the left, the middle 40% is
  303.                visible in the window, and 40% of the text is off-screen to the
  304.                right.  These are the same values passed to scrollbars via the
  305.                ----xxxxssssccccrrrroooollllllllccccoooommmmmmmmaaaannnndddd option.
  306.  
  307.           _p_a_t_h_N_a_m_e xxxxvvvviiiieeeewwww _i_n_d_e_x
  308.                Adjusts the view in the window so that the character position
  309.                given by _i_n_d_e_x is displayed at the left edge of the window.
  310.                Character positions are defined by the width of the character
  311.                0000.
  312.  
  313.           _p_a_t_h_N_a_m_e xxxxvvvviiiieeeewwww mmmmoooovvvveeeettttoooo _f_r_a_c_t_i_o_n
  314.                Adjusts the view in the window so that _f_r_a_c_t_i_o_n of the total
  315.                width of the listbox text is off-screen to the left.  _f_r_a_c_t_i_o_n
  316.                must be a fraction between 0 and 1.
  317.  
  318.           _p_a_t_h_N_a_m_e xxxxvvvviiiieeeewwww ssssccccrrrroooollllllll _n_u_m_b_e_r _w_h_a_t
  319.                This command shifts the view in the window left or right
  320.                according to _n_u_m_b_e_r and _w_h_a_t.  _N_u_m_b_e_r must be an integer.  _W_h_a_t
  321.                must be either uuuunnnniiiittttssss or ppppaaaaggggeeeessss or an abbreviation of one of
  322.                these.  If _w_h_a_t is uuuunnnniiiittttssss, the view adjusts left or right by
  323.                _n_u_m_b_e_r character units (the width of the 0000 character) on the
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. lllliiiissssttttbbbbooooxxxx((((3333TTTTkkkk))))                                                      lllliiiissssttttbbbbooooxxxx((((3333TTTTkkkk))))
  335.  
  336.  
  337.  
  338.                display;  if it is ppppaaaaggggeeeessss then the view adjusts by _n_u_m_b_e_r
  339.                screenfuls.  If _n_u_m_b_e_r is negative then characters farther to
  340.                the left become visible;  if it is positive then characters
  341.                farther to the right become visible.
  342.  
  343.      _p_a_t_h_N_a_m_e yyyyvvvviiiieeeewwww ?_a_r_g_s?
  344.           This command is used to query and change the vertical position of
  345.           the text in the widget's window.  It can take any of the following
  346.           forms:
  347.  
  348.           _p_a_t_h_N_a_m_e yyyyvvvviiiieeeewwww
  349.                Returns a list containing two elements, both of which are real
  350.                fractions between 0 and 1.  The first element gives the
  351.                position of the listbox element at the top of the window,
  352.                relative to the listbox as a whole (0.5 means it is halfway
  353.                through the listbox, for example).  The second element gives
  354.                the position of the listbox element just after the last one in
  355.                the window, relative to the listbox as a whole.  These are the
  356.                same values passed to scrollbars via the ----yyyyssssccccrrrroooollllllllccccoooommmmmmmmaaaannnndddd
  357.                option.
  358.  
  359.           _p_a_t_h_N_a_m_e yyyyvvvviiiieeeewwww _i_n_d_e_x
  360.                Adjusts the view in the window so that the element given by
  361.                _i_n_d_e_x is displayed at the top of the window.
  362.  
  363.           _p_a_t_h_N_a_m_e yyyyvvvviiiieeeewwww mmmmoooovvvveeeettttoooo _f_r_a_c_t_i_o_n
  364.                Adjusts the view in the window so that the element given by
  365.                _f_r_a_c_t_i_o_n appears at the top of the window.  _F_r_a_c_t_i_o_n is a
  366.                fraction between 0 and 1;  0 indicates the first element in the
  367.                listbox, 0.33 indicates the element one-third the way through
  368.                the listbox, and so on.
  369.  
  370.           _p_a_t_h_N_a_m_e yyyyvvvviiiieeeewwww ssssccccrrrroooollllllll _n_u_m_b_e_r _w_h_a_t
  371.                This command adjusts the view in the window up or down
  372.                according to _n_u_m_b_e_r and _w_h_a_t.  _N_u_m_b_e_r must be an integer.  _W_h_a_t
  373.                must be either uuuunnnniiiittttssss or ppppaaaaggggeeeessss.  If _w_h_a_t is uuuunnnniiiittttssss, the view
  374.                adjusts up or down by _n_u_m_b_e_r lines;  if it is ppppaaaaggggeeeessss then the
  375.                view adjusts by _n_u_m_b_e_r screenfuls.  If _n_u_m_b_e_r is negative then
  376.                earlier elements become visible;  if it is positive then later
  377.                elements become visible.
  378.  
  379.  
  380. DDDDEEEEFFFFAAAAUUUULLLLTTTT BBBBIIIINNNNDDDDIIIINNNNGGGGSSSS
  381.      Tk automatically creates class bindings for listboxes that give them
  382.      Motif-like behavior.  Much of the behavior of a listbox is determined by
  383.      its sssseeeelllleeeeccccttttMMMMooooddddeeee option, which selects one of four ways of dealing with the
  384.      selection.
  385.  
  386.      If the selection mode is ssssiiiinnnngggglllleeee or bbbbrrrroooowwwwsssseeee, at most one element can be
  387.      selected in the listbox at once.  In both modes, clicking button 1 on an
  388.      element selects it and deselects any other selected item.  In bbbbrrrroooowwwwsssseeee mode
  389.      it is also possible to drag the selection with button 1.
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. lllliiiissssttttbbbbooooxxxx((((3333TTTTkkkk))))                                                      lllliiiissssttttbbbbooooxxxx((((3333TTTTkkkk))))
  401.  
  402.  
  403.  
  404.      If the selection mode is mmmmuuuullllttttiiiipppplllleeee or eeeexxxxtttteeeennnnddddeeeedddd, any number of elements may
  405.      be selected at once, including discontiguous ranges.  In mmmmuuuullllttttiiiipppplllleeee mode,
  406.      clicking button 1 on an element toggles its selection state without
  407.      affecting any other elements.  In eeeexxxxtttteeeennnnddddeeeedddd mode, pressing button 1 on an
  408.      element selects it, deselects everything else, and sets the anchor to the
  409.      element under the mouse;  dragging the mouse with button 1 down extends
  410.      the selection to include all the elements between the anchor and the
  411.      element under the mouse, inclusive.
  412.  
  413.      Most people will probably want to use bbbbrrrroooowwwwsssseeee mode for single selections
  414.      and eeeexxxxtttteeeennnnddddeeeedddd mode for multiple selections; the other modes appear to be
  415.      useful only in special situations.
  416.  
  417.      In addition to the above behavior, the following additional behavior is  |
  418.      defined by the default bindings:
  419.  
  420.      [1]  In eeeexxxxtttteeeennnnddddeeeedddd mode, the selected range can be adjusted by pressing
  421.           button 1 with the Shift key down:  this modifies the selection to
  422.           consist of the elements between the anchor and the element under the
  423.           mouse, inclusive.  The un-anchored end of this new selection can
  424.           also be dragged with the button down.
  425.  
  426.      [2]  In eeeexxxxtttteeeennnnddddeeeedddd mode, pressing button 1 with the Control key down starts
  427.           a toggle operation: the anchor is set to the element under the
  428.           mouse, and its selection state is reversed.  The selection state of
  429.           other elements isn't changed.  If the mouse is dragged with button 1
  430.           down, then the selection state of all elements between the anchor
  431.           and the element under the mouse is set to match that of the anchor
  432.           element;  the selection state of all other elements remains what it
  433.           was before the toggle operation began.
  434.  
  435.      [3]  If the mouse leaves the listbox window with button 1 down, the
  436.           window scrolls away from the mouse, making information visible that
  437.           used to be off-screen on the side of the mouse.  The scrolling
  438.           continues until the mouse re-enters the window, the button is
  439.           released, or the end of the listbox is reached.
  440.  
  441.      [4]  Mouse button 2 may be used for scanning.  If it is pressed and
  442.           dragged over the listbox, the contents of the listbox drag at high
  443.           speed in the direction the mouse moves.
  444.  
  445.      [5]  If the Up or Down key is pressed, the location cursor (active
  446.           element) moves up or down one element.  If the selection mode is
  447.           bbbbrrrroooowwwwsssseeee or eeeexxxxtttteeeennnnddddeeeedddd then the new active element is also selected and
  448.           all other elements are deselected.  In eeeexxxxtttteeeennnnddddeeeedddd mode the new active
  449.           element becomes the selection anchor.
  450.  
  451.      [6]  In eeeexxxxtttteeeennnnddddeeeedddd mode, Shift-Up and Shift-Down move the location cursor
  452.           (active element) up or down one element and also extend the
  453.           selection to that element in a fashion similar to dragging with
  454.           mouse button 1.
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. lllliiiissssttttbbbbooooxxxx((((3333TTTTkkkk))))                                                      lllliiiissssttttbbbbooooxxxx((((3333TTTTkkkk))))
  467.  
  468.  
  469.  
  470.      [7]  The Left and Right keys scroll the listbox view left and right by
  471.           the width of the character 0000.  Control-Left and Control-Right scroll
  472.           the listbox view left and right by the width of the window.
  473.           Control-Prior and Control-Next also scroll left and right by the
  474.           width of the window.
  475.  
  476.      [8]  The Prior and Next keys scroll the listbox view up and down by one
  477.           page (the height of the window).
  478.  
  479.      [9]  The Home and End keys scroll the listbox horizontally to the left
  480.           and right edges, respectively.
  481.  
  482.      [10] Control-Home sets the location cursor to the the first element in
  483.           the listbox, selects that element, and deselects everything else in
  484.           the listbox.
  485.  
  486.      [11] Control-End sets the location cursor to the the last element in the
  487.           listbox, selects that element, and deselects everything else in the
  488.           listbox.
  489.  
  490.      [12] In eeeexxxxtttteeeennnnddddeeeedddd mode, Control-Shift-Home extends the selection to the
  491.           first element in the listbox and Control-Shift-End extends the
  492.           selection to the last element.
  493.  
  494.      [13] In mmmmuuuullllttttiiiipppplllleeee mode, Control-Shift-Home moves the location cursor to
  495.           the first element in the listbox and Control-Shift-End moves the
  496.           location cursor to the last element.
  497.  
  498.      [14] The space and Select keys make a selection at the location cursor
  499.           (active element) just as if mouse button 1 had been pressed over
  500.           this element.
  501.  
  502.      [15] In eeeexxxxtttteeeennnnddddeeeedddd mode, Control-Shift-space and Shift-Select extend the
  503.           selection to the active element just as if button 1 had been pressed
  504.           with the Shift key down.
  505.  
  506.      [16] In eeeexxxxtttteeeennnnddddeeeedddd mode, the Escape key cancels the most recent selection
  507.           and restores all the elements in the selected range to their
  508.           previous selection state.
  509.  
  510.      [17] Control-slash selects everything in the widget, except in ssssiiiinnnngggglllleeee and
  511.           bbbbrrrroooowwwwsssseeee modes, in which case it selects the active element and
  512.           deselects everything else.
  513.  
  514.      [18] Control-backslash deselects everything in the widget, except in
  515.           bbbbrrrroooowwwwsssseeee mode where it has no effect.
  516.  
  517.      [19] The F16 key (labelled Copy on many Sun workstations) or Meta-w
  518.           copies the selection in the widget to the clipboard, if there is a
  519.           selection.
  520.  
  521.  
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. lllliiiissssttttbbbbooooxxxx((((3333TTTTkkkk))))                                                      lllliiiissssttttbbbbooooxxxx((((3333TTTTkkkk))))
  533.  
  534.  
  535.  
  536.      The behavior of listboxes can be changed by defining new bindings for
  537.      individual widgets or by redefining the class bindings.
  538.  
  539.  
  540. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  541.      listbox, widget
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.                                                                         PPPPaaaaggggeeee 9999
  592.  
  593.  
  594.  
  595.